package com.yjt.fresh.adpater;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yjt.fresh.R;
import com.yjt.fresh.bean.BeanExpress;
import com.yjt.fresh.bean.BeanHistoryDetail;

import java.util.List;

import butterknife.BindView;

/**
 *
 * Created by mcc on 2018/6/10.
 */

public class AdpRvHistoryDetail extends BaseQuickAdapter<BeanHistoryDetail, BaseViewHolder> {



    public AdpRvHistoryDetail(int layoutResId, @Nullable List<BeanHistoryDetail> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanHistoryDetail item) {
        TextView mTvDate=helper.getView(R.id.tvAppRecycleItemAtyExpressDate);

        TextView mTvTime=helper.getView(R.id.tvAppRecycleItemAtyExpressTime);

        View mVHead=helper.getView(R.id.vAppRecycleItemAtyExpressHead);

        View mVContent=helper.getView(R.id.vAppRecycleItemAtyExpressContent);

        TextView mTvStatus=helper.getView(R.id.tvAppRecycleItemAtyExpressStatus);

        TextView mTvContent=helper.getView(R.id.tvAppRecycleItemAtyExpressContent);

        mTvDate.setText(item.getCREATETIME().split(" ")[0]);
        mTvTime.setText(item.getCREATETIME().split(" ")[1]);
        int i = getData().indexOf(item);
        if (i == 0){
            mVHead.setBackgroundResource(R.drawable.shape_43b624);
            int color = mContext.getResources().getColor(R.color.color_43b624);
            mVContent.setBackgroundColor(color);
            mTvDate.setTextColor(color);
            mTvTime.setTextColor(color);
            mTvStatus.setTextColor(color);
            mTvContent.setTextColor(color);
        }
        mTvStatus.setVisibility(View.VISIBLE);
        mTvStatus.setText(item.getCOMPANYNAME());
        mTvContent.setText(item.getCONTENT());

    }
}
